<%@ Page Language="C#" MasterPageFile="~/MasterPages/manager/manager.master" AutoEventWireup="true" CodeFile="AddUpdateProduct.aspx.cs" Inherits="manager_inventory_AddUpdateProduct" Title="Untitled Page" ValidateRequest="false" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <head>

    <link href="../../scripts/subModal/subModal.css" rel="stylesheet" type="text/css" />
    </head>
    <script type="text/javascript" language="javascript" src="../../../scripts/subModal/common.js"></script>
    <script type="text/javascript" language="javascript" src="../../../scripts/prototype.js"></script>
    <script type="text/javascript" language="javascript" src="inventory.js"></script>
    <script type="text/javascript" language="javascript" src="../../../scripts/subModal/subModal.js"></script>

    <h2>Update Product Details</h2>
        <div style="margin-bottom:6px;">
          <b class="rc">
          <b class="rc1"><b></b></b>
          <b class="rc2"><b></b></b>
          <b class="rc3"></b>
          <b class="rc4"></b>
          <b class="rc5"></b></b>

          <div class="rcfg">
            <!-- content goes here -->
            <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save Product Data" />
            &nbsp;
            <button onclick="document.location.href='default.aspx?cid=<%=_viewingCategoryId %>'; return false;">< Back to Inventory</button>
              </div>
          <b class="rc">
          <b class="rc5"></b>
          <b class="rc4"></b>
          <b class="rc3"></b>
          <b class="rc2"><b></b></b>
          <b class="rc1"><b></b></b></b>
        </div>
    <div style="float:left;width:47%;height:150px;line-height:1.8em;margin-right:8px;margin-bottom:8px;">
        <b class="rc"><b class="rc1"><b></b></b><b class="rc2"><b></b></b><b class="rc3"></b>
            <b class="rc4"></b><b class="rc5"></b></b>
        <div class="rcfg">
            <!-- content goes here -->
                <b>Product Details</b><br />
                Product Title:<asp:TextBox ID="txtProductTitle" runat="server" Columns="50" MaxLength="200"></asp:TextBox>
                <asp:RequiredFieldValidator ID="valProductTitle" runat="server" ControlToValidate="txtProductTitle"
                    EnableClientScript="False" ErrorMessage="Please supply a title for the product"></asp:RequiredFieldValidator><br />
                Search Keywords:
                <asp:TextBox ID="txtSearchKeywords" runat="server" Columns="25"></asp:TextBox><br />
                UPC Code: <asp:TextBox ID="txtUPC" runat="server" />
                        <asp:CustomValidator ID="validateUPC" runat="server" ControlToValidate="txtUPC" Display="Dynamic"
                            EnableClientScript="False" ErrorMessage="That UPC code already exists" OnServerValidate="validateUPC_ServerValidate"></asp:CustomValidator><br />
                List Price: <%=GetCurrencySymbol()%><asp:TextBox ID="txtPrice" runat="server" Columns="5" Text="0.00" /><asp:RegularExpressionValidator runat="server" ID="valPrice" ControlToValidate="txtPrice" ErrorMessage="A numeric value is required" ValidationExpression="^\d+(?:\.\d{0,2})?$" />&nbsp;&nbsp;
                Discount: <%=GetCurrencySymbol()%><asp:TextBox ID="txtDiscount" runat="server" Columns="5" Text="0.00" /><asp:RegularExpressionValidator ID="valDiscount" runat="server" ControlToValidate="txtDiscount" ErrorMessage="A numeric value is required" ValidationExpression="^\d+(?:\.\d{0,2})?$" />
    </div> <b class="rc"><b class="rc5"></b><b class="rc4"></b><b class="rc3"></b><b
        class="rc2"><b></b></b><b class="rc1"><b></b></b></b></div>

        <div style="float:right;width:47%;height:auto;margin-bottom:8px;">
            <b class="rc"><b class="rc1"><b></b></b><b class="rc2"><b></b></b><b class="rc3"></b>
                <b class="rc4"></b><b class="rc5"></b></b>
            <div class="rcfg">
                <!-- content goes here -->
        <b>Category</b><br />
        <asp:TreeView ID="tvCategories" runat="server" OnDataBinding="tvCategories_DataBinding"
            ShowLines="True" SelectedNodeStyle-Font-Bold="true" OnAdaptedSelectedNodeChanged="OnTreeSelection">
        </asp:TreeView>
        <asp:HiddenField runat="server" ID="fieldSelectedCategoryId" Value='<%#_viewingCategoryId %>' />
        <asp:CustomValidator ID="valCategory" runat="server" ControlToValidate="txtProductTitle"
            EnableClientScript="False" ErrorMessage="Please select a category for this product"
            OnServerValidate="valCategory_ServerValidate" ValidateEmptyText="True"></asp:CustomValidator>
            </div>
            <b class="rc"><b class="rc5"></b><b class="rc4"></b><b class="rc3"></b><b class="rc2">
                <b></b></b><b class="rc1"><b></b></b></b>
        </div>
        
        
    <div id="po" style="float:left;width:47%;height:auto;line-height:1.3em;margin-right:8px;margin-bottom:8px;">
        <b class="rc"><b class="rc1"><b></b></b><b class="rc2"><b></b></b><b class="rc3"></b>
            <b class="rc4"></b><b class="rc5"></b></b>
        <div class="rcfg">
            <!-- content goes here -->
            <b>Product Options</b><br />
            <asp:GridView ID="gvProductOptions" runat="server" AutoGenerateColumns="False"
                DataSourceID="odsProductOptions" OnRowDataBound="gvProductOptions_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="Title" HeaderText="Option" SortExpression="Title" />
                    <asp:TemplateField HeaderText="Value">
                        <ItemTemplate>
                            <asp:TextBox ID="txtOptionValue" runat="server"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="odsProductOptions" runat="server" DataObjectTypeName="TanashCMS.Business.ProductOption"
                DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}"
                SelectMethod="ListOptionTypes" TypeName="TanashCMS.Business.ProductOption" UpdateMethod="Update" OnSelecting="odsProductOptions_Selecting">
                <SelectParameters>
                    <asp:ProfileParameter Name="WebsiteID" PropertyName="WebsiteID" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
        <b class="rc"><b class="rc5"></b><b class="rc4"></b><b class="rc3"></b><b class="rc2">
            <b></b></b><b class="rc1"><b></b></b></b>
    </div>

        <div style="float:left;width:47%;height:auto;margin-bottom:8px;">
          <b class="rc">
          <b class="rc1"><b></b></b>
          <b class="rc2"><b></b></b>
          <b class="rc3"></b>
          <b class="rc4"></b>
          <b class="rc5"></b></b>

          <div class="rcfg">
            <!-- content goes here -->
        <b>Image</b>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="showPopWin('../dialogs/SelectImage.aspx', 700, 500, onSelectImage);">Choose Image...</a><br />
        <asp:Image runat="server" ID="productImage" />
        <input type="hidden" runat="server" id="hiddenImageUrl" />
        <script type="text/javascript">
            ctrlImage = $('<%=productImage.ClientID %>');
            litImage = $('<%=hiddenImageUrl.ClientID %>');
        </script>
          </div>
            <b class="rc"><b class="rc5"></b><b class="rc4"></b><b class="rc3"></b><b class="rc2">
                <b></b></b><b class="rc1"><b></b></b></b>
        </div>

    
    <div style="margin-bottom: 6px; float:left;width:100%;">
        <b class="rc"><b class="rc1"><b></b></b><b class="rc2"><b></b></b><b class="rc3"></b>
            <b class="rc4"></b><b class="rc5"></b></b>
        <div class="rcfg">
            <!-- content goes here -->
            <b>Further Information</b>&nbsp;<a href="javascript:;" onclick="$('pInfo').toggle()">(Show/Hide)</a><br />
            <asp:Panel runat="server" ID="panelFutherInfo" Visible="true">
            <div id="pInfo" style="display:none;">
                <FCKeditorV2:FCKeditor ID="fckProductDetails" runat="server" Height="400px" BasePath="/fckeditor/" Debug="true">
                </FCKeditorV2:FCKeditor>
            </div>
            </asp:Panel>
        </div>
        <b class="rc"><b class="rc5"></b><b class="rc4"></b><b class="rc3"></b><b class="rc2">
            <b></b></b><b class="rc1"><b></b></b></b>
    </div>

<div id="popupContainer">
  <div id="popupInner">
    <div id="popupTitleBar">
      <div id="popupTitle"></div>
      <div id="popupControls">
        <img src="../../scripts/subModal/close.gif" onclick="hidePopWin(false);" />
      </div>
    </div>
    <iframe src="../../scripts/subModal/loading.html" 
      style="width:100%;height:100%;background-color:transparent;" 
      scrolling="auto" frameborder="0" 
      allowtransparency="true" id="popupFrame" 
      name="popupFrame" width="100%" height="100%">
    </iframe>
  </div>
</div>


</asp:Content>

